f(int*a,int*b){return*a-*b;}
unsigned r[1<<20];
union{char c[3];int i;}l;
main(o,s,c,t)
{
	read(0,r,10);
	read(0,&o,4);
	read(0,r,20);
	read(0,&s,4);
	read(0,r,o-38);
	s/=3;
	for(o=0;o<s;r[o++]=l.i)
		read(0,l.c,3);
	qsort(r,s,4,f);

	for(o=t=c=0;o<s;o++)
		if(r[o]!=t)t=r[o],c++;

	printf("%d\n",c+(*r==0));
}
